package com.doyambean.springcloud.fegin.demo.run;

import com.doyambean.springcloud.fegin.demo.service.FeignClientService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class FeignClintRunner implements ApplicationRunner {

    @Autowired
    private FeignClientService feignClientService;

    @Override
    public void run(ApplicationArguments args) throws Exception {

        String ret = this.doGetService();
        log.info(ret);
    }

    private String doGetService() {

        return feignClientService.doDemo();
    }
}
